
package com.probiz.estore.eai.catalog;

import java.util.List;

import javax.xml.bind.JAXBElement;

import com.probiz.estore.eai.catalog.generated.InventoryClass;
import com.probiz.estore.eai.catalog.generated.InventoryClassSet;
import com.probiz.estore.eai.catalog.generated.ObjectFactory;
import com.probiz.estore.eai.common.GenericMarshaller;
import com.probiz.estore.eai.exception.EaiException;


public class InventoryClassMarshaller extends GenericMarshaller<InventoryClassSet> {
	@Override
	public JAXBElement<InventoryClassSet> populateEntitySetElement()
			throws EaiException {
		ObjectFactory factory = new ObjectFactory();

		InventoryClassSet inventoryClassSet = factory.createInventoryClassSet();
		inventoryClassSet.setRoottag("inventoryclass");
		
		List<InventoryClass> inventoryClassList = inventoryClassSet.getInventoryclass();
		
		InventoryClass inventoryClass = factory.createInventoryClass();
		inventoryClass.setCode("01");
		inventoryClass.setName("手机");
		inventoryClassList.add(inventoryClass);
		
		inventoryClass = factory.createInventoryClass();
		inventoryClass.setCode("0101");
		inventoryClass.setName("nokia");
		inventoryClassList.add(inventoryClass);
		
		inventoryClass = factory.createInventoryClass();
		inventoryClass.setCode("0102");
		inventoryClass.setName("三星");
		inventoryClassList.add(inventoryClass);
		
		inventoryClass = factory.createInventoryClass();
		inventoryClass.setCode("02");
		inventoryClass.setName("电脑");
		inventoryClassList.add(inventoryClass);


		JAXBElement<InventoryClassSet> inventoryClassDataElement=factory.createUfinterface(inventoryClassSet);
	
		return inventoryClassDataElement;
	}
}
